<?php

namespace Modules\DataCheck\Enums;

use Modules\DataCheck\Enums\Tratis\EnumExtend;

/**
 * 任务执行方式枚举
 */
enum RunModeEnum: int implements Enum
{
    use EnumExtend;

    case CONSOLE = 1;
    case JOB = 2;
    case API = 3;

    /**
     * @return string
     */
    public function message(): string
    {
        return match ($this) {
            self::CONSOLE => '命令行',
            self::JOB => '队列',
            self::API => 'API',
            default => '',
        };
    }
}